# Tile class and descriptor

from crl_mapmngr import MapMngr

class TileDescriptor:
  __slots__ = [
    "icoch", "icofg", "icobg",
    "name", "desc", "passable",
    "opendoor", "closedtile",
    "closeddoor", "opentile"]
  
  def __init__(self, icoch, icofg,
    icobg, name, desc, passable,
    opendoor, closedtile,
    closeddoor, opentile):
      self.icoch = icoch
      self.icofg = icofg
      self.icobg = icobg
      self.name = name
      self.desc = desc
      self.passable = passable
      self.opendoor = opendoor
      self.closedtile = closedtile
      self.closeddoor = closeddoor
      self.opentile = opentile
  
  def getIconCharacter(self):
    return self.icoch
  
  def getIconFg(self):
    return self.icofg
  
  def getIconBg(self):
    return self.icobg
  
  def getIcon(self):
    return (self.icoch, self.icofg, self.icobg)
  
  def getName(self):
    return self.name
  
  def getDescription(self):
    return self.desc
  
  def isPassable(self):
    return self.passable
  
  def isOpenDoor(self):
    return self.opendoor
  
  def isClosedDoor(self):
    return self.closeddoor
  
  def openTileID(self):
    return self.opentile
  
  def closedTileID(self):
    return self.closedtile

def Tile:
  __slots__ = [
    "desc"]
  
  def __init__(self):
    self.desc = None
  
  def getDescriptor(self):
    return self.desc
  
  def setDescriptor(self, desc):
    self.desc = desc
  
  def getIconCharacter(self):
    return self.desc.getIconCharacter()
  
  def getIconFg(self):
    return self.desc.getIconFg()
  
  def getIconBg(self):
    return self.desc.getIconBg()
  
  def getIcon(self):
    return self.desc.getIcon()
  
  def getName(self):
    return self.desc.getName()
  
  def getDescription(self):
    return self.desc.getDescription()
  
  def isPassable(self):
    return self.desc.isPassable()
  
  def isOpenDoor(self):
    return self.desc.isOpenDoor()
  
  def isClosedDoor(self):
    return self.desc.isClosedDoor()
  
  def openTileID(self):
    return self.desc.openTileID()
  
  def closedTileID(self):
    return self.desc.closedTileID()
